package cn.com.pc.content.vo;

import cn.com.pc.content.domain.content.Content;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.beans.BeanUtils;

/**
 * 定制内容视图
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString(callSuper = true)
public class CustomizedContentViewVO extends Content {

    private String viewType;
    private String view;

    public static CustomizedContentViewVO from(Content content, String viewType, String view) {
        CustomizedContentViewVO customizedContentViewVO = new CustomizedContentViewVO();
        BeanUtils.copyProperties(content, customizedContentViewVO);
        customizedContentViewVO.setViewType(viewType);
        customizedContentViewVO.setView(view);
        return customizedContentViewVO;
    }
}
